/* menu.h

Copyright (C) Alex S. (mailto: md5sum@alexsp.ru)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details
http://www.gnu.org/licenses/gpl-2.0.html.

You should have received a copy of the GNU General Public License
along with this program in the file gpl-2.0.txt;
if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/


#ifndef MENU_H_
#define MENU_H_
#include "hardware.h"

typedef enum{DAY_SELECT,DAY_EDIT,MONTH_SELECT,MONTH_EDIT,YEAR_SELECT,YEAR_EDIT,
	HOUR_SELECT,HOUR_EDIT,MINUTE_SELECT,MINUTE_EDIT,
	LED_MIN_SELECT,LED_MIN_EDIT,LED_MAX_SELECT,LED_MAX_EDIT,
	LED_TIME_SELECT,LED_TIME_EDIT,
	TIME_ADJ_SELECT,TIME_ADJ_EDIT,PRESS_ADJ_SELECT,PRESS_ADJ_EDIT,
	DRAW_MENU,EXIT,MENU_NONE} menu_item_t;

#define KEY_PIN	PINB
#define KEY_DDR DDRB
#define KEY_PORT PORTB
#define KEY_ENTER (1<<2)
#define KEY_PLUS (1<<4)
#define KEY_MINUS (1<<3)
#define KEY_CHANGE (1<<7)
#define DOUBLE_ENTER 7

uint8_t check_keys();
void menu(uint8_t key);

#endif /* MENU_H_ */
